using System;
using System.Runtime.CompilerServices;
using System.ServiceModel;

namespace ns8
{
	internal static class Class45
	{
		[CompilerGenerated]
		private sealed class Class46
		{
			public Action<Class40> action_0;

			internal object method_0(Class40 class40_0)
			{
				action_0(class40_0);
				return null;
			}
		}

		public static void smethod_0(Action<Class40> action_0)
		{
			smethod_2((Func<Class40, object>)delegate(Class40 class40_0)
			{
				action_0(class40_0);
				return null;
			});
		}

		public static object smethod_1(Func<Class40, object> func_0)
		{
			return smethod_2(func_0);
		}

		public static T smethod_2<T>(Func<Class40, T> func_0)
		{
			try
			{
				Class40 @class = new Class40();
				bool flag = false;
				try
				{
					T result = func_0(@class);
					@class.method_2();
					flag = true;
					return result;
				}
				catch (EndpointNotFoundException)
				{
					@class.method_1();
					return smethod_2(func_0);
				}
				catch (CommunicationException)
				{
					@class.method_1();
					return smethod_2(func_0);
				}
				catch (TimeoutException)
				{
					@class.method_1();
					return smethod_2(func_0);
				}
				catch (Exception)
				{
					@class.method_1();
					throw;
				}
				finally
				{
					if (!flag && @class.CommunicationState_0 != CommunicationState.Closed)
					{
						@class.method_1();
					}
				}
			}
			catch
			{
				return default(T);
			}
		}
	}
}
